{extend name="common/base"/}
{block name="style"}

<link rel="stylesheet" href="{__CSS__}/user.css?v={:get_system_config('web','version')}" media="all">
{/block}
<!-- 主体 -->
{block name="body"}
{include file="common/header" /}
<div class="user">
	<div class="user-home"><a href="/">首页</a> - 个人中心</div>
	<div class="user-box clearfix">
		<div class="l user-menu">
			{include file="common/usermenu" /}
		</div>
		<div class="r user-right">
			<div class="user-detail">
				<div class="layui-row">
					 <div class="layui-col-md4">
						<form class="layui-form" method='post'  id="bjForm">
								<div class="layui-input-inline">
									<select name="bj_code" lay-filter="bjSelect">
										{volist name="bjlist" id="v"}
										<option value="{$v.bj_code}">{$v.bj_name}</option>
										{/volist}
									</select>
								</div>
								<button class="layui-btn layui-btn-primary" lay-submit="" lay-filter="submitBtn">&nbsp;切换&nbsp;</button>
						</form>
					</div>
					<div class="layui-col-md8">
						<div class="user-detail-h3">
							当前班级  【 {$param['bj_name']} 】
						</div>
					</div>
				</div>

			</div>
		</div>
	</div>
</div>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script src="{__LAYUI__}/layui.js"></script>
<script language="javascript" src="{__JS__}/laydate/laydate.js"></script>
<script>
layui.use(['form','layer'], function(){
  var form = layui.form;
  var layer = layui.layer;
      // 表单提交
    form.on('submit(submitBtn)', function(data){
        
        var bj_data={bjcode:data.field.bj_code};

        $.post('/home/user/do_change_bj', bj_data, 
        	function(res){
        	//alert(res.msg);
            if(res.code === 0){

                layer.msg(res.msg,{ icon: 1 });
                setTimeout(function(){
                    location.reload();
                }, 1500);
            } else {
                layer.msg(res.msg, { icon: 2 });
            }
        });

        return false;
    });


});
</script>

{/block}
<!-- /脚本 -->